package com.xx.sg.controller;

import com.xx.sg.own.entity.FacilityFireTeam;
import com.xx.sg.own.service.FacilityFireTeamService;
import com.xx.sg.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/facility/fireTeam")
@Tag(name = "灭火队API", description = "灭火队API")
public class FacilityFireTeamController {

    @Autowired
    private FacilityFireTeamService facilityFireTeamService;

    @GetMapping("/list")
    @Operation(summary = "获取灭火队列表", description = "获取灭火队列表")
    public R list(@RequestParam(required = false) FacilityFireTeam fireTeam) {
        List<FacilityFireTeam> list = facilityFireTeamService.selectFireTeamList(fireTeam);
        R r = R.success(list);
        r.put("message", "成功");
        r.put("success", true);
        return r;
    }
}
